<template>
  <div class="flow-row-container">
    <FlowApproverNode v-if="props.node && (props.node.type == 1 || node.type == 6)" :node="props.node" :readable="props.readable" />
    <FlowCopyerNode v-if="props.node && props.node.type == 2" :node="props.node" :readable="props.readable" />
    <BranchNode v-if="props.node && props.node.type == 4" :node="props.node" :readable="props.readable" />
    <EventNode v-if="props.node && props.node.type == 5" :node="props.node" :readable="props.readable" />
    <WriteNode v-if="props.node && props.node.type == 0" :node="props.node" :readable="props.readable" />
    <SuggestNode v-if="props.node && props.node.type == 7" :node="props.node" :readable="props.readable" />
    <ParallelNode v-if="props.node && props.node.type == 9" :node="props.node" :readable="props.readable" />
    <PolymerizeNode v-if="props.node && props.node.type == 11" :node="props.node" :readable="props.readable" />
    <NoticeNode v-if="props.node && props.node.type == 20" :node="props.node" :readable="props.readable" />
    <FlowNode v-if="props.node && props.node.childNode && props.node.childNode.hasOwnProperty('name')" :node="props.node.childNode" :readable="props.readable" />
  </div>
</template>
<script lang="ts" setup name="FlowNode">
  import FlowApproverNode from './approver/index.vue';
  import FlowCopyerNode from './copyer/index.vue';
  import NoticeNode from './notice/index.vue';
  import WriteNode from './write/index.vue';
  import EventNode from './event/index.vue';
  const BranchNode=defineAsyncComponent(() => import('./branch/index.vue'));
  const SuggestNode=defineAsyncComponent(() => import('./branch/Suggest.vue'));
  const ParallelNode=defineAsyncComponent(() => import('./branch/Parallel.vue'));
  const PolymerizeNode=defineAsyncComponent(() => import('./branch/Polymerize.vue'));
  //------------------接收传入参数(组件)-------------------
  const props = defineProps({
    node: {
      type: Object,
      default: function() {
        return {};
      },
    },
    readable: {
      type: Boolean,
      default: false,
    },
  })
</script>
